/*
 * @Author: Liang 1931226988@qq.com
 * @Date: 2023-08-19 14:44:12
 * @LastEditors: 凉月 1931226988@qq.com
 * @LastEditTime: 2023-08-21 21:12:40
 * @FilePath: \WanYi\src\api\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Serve from "@/utils/request";

class Request extends Serve {
  // 获取首页推荐数据
  reqHomeInfo(time: number) {
    return this.get({
      url: `https://m.you.163.com/xhr/index.json?__timestamp=${time}`,
    });
  }
  // 获取频道接口
  reqChannelInfo(time: number, categoryId: number) {
    return this.get({
      url: `https://m.you.163.com/item/list.json?__timestamp=${time}&categoryId=${categoryId}`,
    });
  }

  // 获取分类接口
  reqClassificationInfo(time: number, categoryId: number = 11) {
    return this.get({
      url: `https://m.you.163.com/item/cateList.json?__timestamp=${time}&categoryId=${categoryId}`,
    });
  }

  // 值得买
  reqMeritInfo() {
    return this.get({
      url: 'https://m.you.163.com/topic/v1/know/navWap.json'
    })
  }

  //值得买 瀑布数据
  reqMeritList(page:number , size:number) {
    return this.get({
      url: `https://m.you.163.com/topic/v1/find/recAuto.json?page=${page}&size=${size}`
    })
  }
}

export default new Request();
